from django.urls import include, path
from rest_framework.routers import DefaultRouter
from . import views

router = DefaultRouter(trailing_slash=False)
router.register(r'relationship', views.UserRelationshipViewSet)
router.register(r'device', views.UserDeviceViewSet)
router.register(r'userstats', views.UserViewSet)
router.register(r'group', views.GroupViewSet)
router.register(r'activity', views.UserActivityViewSet)
router.register(r'warning', views.UserWarningViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('top', views.user_top),                                                # 活跃用户
    path('dailysummary', views.DailySummaryView.as_view()),                     # 每日用户数统计
    path('demand', views.UserDemandView.as_view()),                             # 用户需求统计
    path('app/count', views.app_installation_count),                            # 应用装机量统计
    path('app/tag', views.AppTagView.as_view()),                                # 应用类别统计
    path('appvisit/count/<str:username>', views.AppVisitCountView.as_view()),   # 访问应用数量和次数
    path('appvisit/trend/<str:username>', views.AppVisitTrendView.as_view()),   # 访问应用趋势图
    path('geotrack/<str:username>', views.GeoTrackView.as_view()),              # 地理位置轨迹
    path('safetyscore/users', views.users_score),                               # 风险用户列表
    path("safetyscore/user", views.user_score),                                 # 用户安全分详情
    path("safetyscore/distribution", views.users_score_distribution),           # 用户安全评分分布
    path("statistic", views.user_statistic),                                    # 一周内用户数据统计信息
    path("creditscore/user", views.user_credit_score),                          # 用户信誉分仪表盘
    path("logout", views.user_logout),                                        # 用户强制登出
    path("freeze", views.user_freeze),                                          # 冻结账户
    path("forbidden", views.user_forbidden),                                    # 冻结账户
    path("top10", views.user_top10),
    path("share/detail", views.user_share_detail),                              # 用户详情
    path('docexport/<str:username>', views.UserdataDocExport.as_view()),        # 导出用户数据报告
]
